<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
    <div id="app">  
        <h1 v-for="(v,k,index) in obj">{{v}}</h1>
        <button v-myshow="true" @click="del">删除</button>
    </div>
    <script src="./vue.js"></script>
    <script>
      

      new Vue({
        el:"#app",
        data(){
          return {
            msg:"你好",
            obj:{
              name:"小王",
              sex:"男"
            }
          }
        },
        methods:{
          del(){
            //  this.$delete 删除对象或数组的值
            this.$delete(this.obj,'sex')
          }
        }
      })





    </script>
</body>
</html>